load("@rules_cc//cc:cc_library.bzl", "cc_library")

genrule(
    name = "cprver_h",
    outs = ["include/cpr/cprver.h"],
    cmd = "echo -e '#pragma once\n#define CPR_VERSION \"{}\"' > $@".format(module_version()),
)

cc_library(
    name = "cpr",
    srcs = glob(["cpr/**/*.cpp"]),
    hdrs = glob(["include/cpr/**/*.h"]) + [":cprver_h"],
    includes = ["include"],
    visibility = ["//visibility:public"],
    deps = ["@curl"],
)
